package gaoji;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

//测试：线程池
public class test3 {
	public static void main(String[] args) {
		// 创建线程池
		ExecutorService service=Executors.newFixedThreadPool(10);
		
		//执行
		service.execute(new myThread());
		service.execute(new myThread());
		service.execute(new myThread());
		service.execute(new myThread());
		
		//关闭连接
		service.shutdown();
	}
}
class myThread implements Runnable{

	@Override
	public void run() {
			System.out.println(Thread.currentThread().getName());
		
	}
	
	
}
